package com.sky.controller.mirror;


import com.sky.entity.WalletTransactions;
import com.sky.result.Result;
import com.sky.service.WalletTransactionsService;
import com.sky.vo.WalletTransactionsVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author GHOSTER by RemSynch
 * @since 2024-10-24
 */
@RestController
@RequestMapping("/admin/walletTransactions")
public class WalletTransactionsController {

    @Autowired
    private WalletTransactionsService walletTransactionsService;

    @GetMapping("/list")
    public Result<List<WalletTransactionsVO>> getAllWalletTransactions() {
        return Result.success(walletTransactionsService.listWalletTransactions());
    }

    @GetMapping("/list/{id}")
    public Result<List<WalletTransactionsVO>> getAllWalletTransactionsByUserId(@PathVariable String id) {
        return Result.success(walletTransactionsService.listWalletTransactionsByUserId(id));
    }
}
